/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.view.tutorial;

import java.awt.*;
import javax.swing.*;
import vical.view.tutorial.action.TutorialAddTaskAction;
import vical.view.tutorial.action.TutorialDeleteTaskAction;
import vical.view.tutorial.action.TutorialNavigationAction;

/**
 * The Guide of other tutorials, for example, list all the available tutorials
 * and trigger them when user selects one of them.
 * 
 * @author Can
 */
public class TutorialGuide extends GlassTutorial {
    
    private JPanel tutorialsPanel;
    private TutorialContainer componentsProvider;

    /*
     * The provider must not be null!
     */
    public TutorialGuide(TutorialContainer provider) {
        super(null, provider.getJMenuBar(), provider.getContentPane());
        this.componentsProvider = provider;
        this.initComponents();
    }
    
    private void initComponents() {
        this.tutorialsPanel = new JPanel();
        this.tutorialsPanel.setOpaque(false);
        this.tutorialsPanel.setLayout(new BoxLayout(this.tutorialsPanel, BoxLayout.Y_AXIS));
        
        JButton addTaskButton = new TutorialButton(new TutorialAddTaskAction(componentsProvider));
        this.tutorialsPanel.add(addTaskButton);
        JButton deleteTaskButton = new TutorialButton(new TutorialDeleteTaskAction(componentsProvider));
        this.tutorialsPanel.add(deleteTaskButton);
        JButton editTaskButton = new TutorialButton("How to edit an entry? (not finished)");
        this.tutorialsPanel.add(editTaskButton);
        JButton navigationButton = new TutorialButton(new TutorialNavigationAction(componentsProvider));
        this.tutorialsPanel.add(navigationButton);
        JButton temp5 = new TutorialButton("To be extended...");
        this.tutorialsPanel.add(temp5);
        
        this.setLayout(new FlowLayout(FlowLayout.CENTER));
        this.add(Box.createRigidArea(new Dimension(0, 400)));
        this.add(tutorialsPanel);
    }
}
